import request from '@/utils/request';
import { stringify } from 'qs';

//获取合同列表
export async function queryContractList(params) {
  return request(`/blade-user/contract/list/user?${stringify(params)}`);
}

//账期申请
export async function contractApply(params) {
  return request(`/blade-user/contract/apply`, {
    method: 'POST',
    data: params,
  });
}

//账期重新申请
export async function contractReApply(params) {
    return request(`/blade-user/contract/reApply`, {
      method: 'POST',
      data: params,
    });
  }

//获取实名认证信息
export async function queryAlipayCertificationget() {
  return request('/blade-user/contract/alipayCertification');
}

//判断是否已经存在申请或者生效的合同
export async function contractExist(params) {
  return request(`/blade-user/contract/exist?${stringify(params)}`);
}

//查看账期详情
export async function contractDetail(params) {
  return request(`/blade-user/contract/detail?${stringify(params)}`);
}

//判断是否还有未完结的账期订单
export async function hasFinish(params) {
  return request(`/blade-user/contract/hasFinish?${stringify(params)}`);
}

//终止合同
export async function contractClose(params) {
  return request(`/blade-user/contract/close?${stringify(params)}`, {
    method: 'POST',
    // data: params,
  });
}

//获取要申请的供应商
export async function queryListByStoreName(params) {
  return request(`/blade-goods/zjfstore/listByStoreName?${stringify(params)}`);
}
